/**
 * 
 */
package com.skood.security.domain;

import java.util.List;

import org.apache.ibatis.type.Alias;

import com.skood.common.domain.EntityBean;

/**
 * @author keege
 * @date 2013-12-13
 */
@Alias("resource")
public class Resource extends EntityBean {
	private static final long serialVersionUID = -2573376805878234884L;

	private String code;
	private String name;
	private String url;
	private String view;
	private String description;
	private Integer type;
	private Integer sort;
	private String icon;
	private String configuration;
	private Resource parent;
	private boolean leaf;
	private List<Resource> children;
	private int childrenSize;
	private boolean checked = false;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getView() {
		return view;
	}
	public void setView(String view) {
		this.view = view;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public String getConfiguration() {
		return configuration;
	}
	public void setConfiguration(String configuration) {
		this.configuration = configuration;
	}
	public Resource getParent() {
		return parent;
	}
	public void setParent(Resource parent) {
		this.parent = parent;
	}
	public Integer getSort() {
		return sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
	
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public List<Resource> getChildren() {
		return children;
	}
	public void setChildren(List<Resource> children) {
		this.children = children;
	}
	public boolean isLeaf() {
		this.leaf=childrenSize==0;
		return this.leaf;
	}
	public int getChildrenSize() {
		return childrenSize;
	}
	public void setChildrenSize(int childrenSize) {
		this.childrenSize = childrenSize;
	}
	public boolean isChecked() {
		return checked;
	}
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	
}
